package com.frank.subject.infra.basic.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.frank.subject.infra.basic.entity.SubjectInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Frank Zou
 * @version v0.0.1
 * @date 2024/3/5
 * @description 
 */
@Mapper
public interface SubjectInfoMapper extends BaseMapper<SubjectInfo> {

    /**
     * Count by condition
     * @param subjectInfo subject information
     * @param labelId label id
     * @param categoryId category id
     * @return count
     */
    int countByCondition(@Param("subjectInfo") SubjectInfo subjectInfo, @Param("labelId") Long labelId, @Param("categoryId") Long categoryId);

    /**
     * Query page
     * @param subjectInfo subject information
     * @param categoryId category id
     * @param labelId label id
     * @param start start
     * @param pageSize page size
     * @return list
     */
    List<SubjectInfo> queryPage(@Param("subjectInfo") SubjectInfo subjectInfo, @Param("categoryId") Long categoryId, @Param("labelId") Long labelId, @Param("start") int start, @Param("pageSize") Integer pageSize);
}